package com.jubull.rule.engine.functions;

import com.alibaba.fastjson.JSON;
import com.jubull.rule.engine.beans.EventBean;
import org.apache.flink.api.common.functions.MapFunction;

/**
 * @author liuyun
 * @title: json2LogBeanFunction
 * @projectName jubull_marking
 * @description: TODO
 * @date 2022-3-25 01:21
 */
public class json2LogBeanFunction implements MapFunction<String, EventBean> {

    @Override
    public EventBean map(String s) throws Exception {

        EventBean eventBean = null;

        try {
            eventBean = JSON.parseObject(s, EventBean.class);
        } catch (Exception e) {
            e.printStackTrace();
        }

        return eventBean;
    }
}
